package com.kyh.entity;

import javax.persistence.Table;


import java.util.Date;

import com.kyh.annotation.Model;
import com.kyh.entity.base.BaseEntity;

/**
*/
@Table(name="file_log")
public class FileLog extends BaseEntity<FileLog> {

	@Model(nameTable="id")
	private Long id; // 主键ID
	@Model(nameTable="url")
	private String url; // 文件路径
	@Model(nameTable="type")
	private Integer type; // 类型，1文章封面
	@Model(nameTable="sourceId")
	private Long sourceId; // 来源ID
	@Model(nameTable="status")
	private Integer status; // 
	@Model(nameTable="createTime",type=Model.TYPE.DATE, format="yyyy-MM-dd HH:mm:ss")
	private Date createTime; // 
	@Model(nameTable="updateTime",type=Model.TYPE.DATE, format="yyyy-MM-dd HH:mm:ss")
	private Date updateTime; // 

	public Long getId() {
		return id;
	}
	public FileLog setId(Long id) {
		this.id = id;
		return this;
	}
	public String getUrl() {
		return url;
	}
	public FileLog setUrl(String url) {
		this.url = url;
		return this;
	}
	public Integer getType() {
		return type;
	}
	public FileLog setType(Integer type) {
		this.type = type;
		return this;
	}
	public Long getSourceId() {
		return sourceId;
	}
	public FileLog setSourceId(Long sourceId) {
		this.sourceId = sourceId;
		return this;
	}
	public Integer getStatus() {
		return status;
	}
	public FileLog setStatus(Integer status) {
		this.status = status;
		return this;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public FileLog setCreateTime(Date createTime) {
		this.createTime = createTime;
		return this;
	}
	public Date getUpdateTime() {
		return updateTime;
	}
	public FileLog setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
		return this;
	}

	public static FileLog fileLog(
			String url,
			Integer type,
			Long sourceId,
			Integer status
			) {
		FileLog entity = new FileLog();
		entity.setUrl(url);
		entity.setType(type);
		entity.setSourceId(sourceId);
		entity.setStatus(status);
		return entity;
	}
}